function tripod
fn = '/home/hbui/kratos_janosch/tripod.gid/tripod.GiD.msh';
mg = fem2.gid.GidMeshGenerator(fn);
mesh = mg.getMesh(3);
M = fem2.Model(mesh);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% conditions
%%%%%%%%%%%%%%%%%%%%%%%%%%%%
meshUtil = fem2.MeshUtilities(mesh);
c1 = fem2.Constraint([0 0 0]); %fix x, fix y
top = meshUtil.seekNodesOnSurface(0,1,0,-13);
bot = meshUtil.seekNodesOnSurface(0,1,0,10);
mesh.setConstraint(c1,bot);
mesh.setNumberOfFields(3);
F = -10.0;
for i=1:top.size()
    f = fem2.Force(top.get(i-1),[0 F 0]);
    M.addLoad(f);
end
% plotMesh(mesh,{'normal','conditions'});
% return
%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% element declaration
%%%%%%%%%%%%%%%%%%%%%%%%%%%%
nb = mesh.countBlocks();
nu = 0.3;
E = 1e3;
t = 1.0;
rho = 0.0;
ss = fem2.enu.State.THREE_DIMENSIONAL;
mm = fem2.material.StVenantKirchhoffMM(E, nu, t, rho, ss);
for i=1:nb
    
    %option StructuralELement
    e = fem2.StructuralElement(mesh.getBlock(i-1),mm);
    %     e.setIntegrationType(fem2.enu.IntegrationType.REDUCED_INTEGRATION);
    %     e.setIntegrationType(fem2.enu.IntegrationType.SELECTIVE_REDUCED_INTEGRATION);
    
    %option BBarStructuralElement
    %     e = fem2.BBarStructuralElement(mesh.getFace(i-1),cm);
    
    M.addElement(e);
end
%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% solve
%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% M.preAnalysis();
M.Initialize();
n = mesh.countDofs();

kt = sparse(n,n);
M.countElements()
for i=1:nb
    dofs = mesh.getBlock(i-1).getDofNumbers();
    len = size(dofs(:),1);
    kte = inf.jlinalg.Array2DMatrix(len,len);
    kte = M.getElement(i-1).computeKte(kte);
    for j=1:len
        for k=1:len
            if dofs(j)~=-1 && dofs(k)~=-1
                kt(dofs(j)+1,dofs(k)+1) = kt(dofs(j)+1,dofs(k)+1) ...
                    + kte.get(j-1,k-1);
            end
        end
    end
end

r = zeros(1,n);
r = M.assembleR(r);
u = kt\r
M.setX(1,u);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% post process
%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% plotDeformedMesh(mesh,1);
